package com.office.automate.frontier.utility;

public class Utility {

	private int currentUserSecurityLevel;

	public Utility(int currentUserSecurityLevel) {
		this.currentUserSecurityLevel = currentUserSecurityLevel;
	}

	public boolean isFunctionalSecurityAllow(String configuredSecurityLevels) {

		if (configuredSecurityLevels.equals("ALL")) {
			return true;
		}

		String[] securityLevels = configuredSecurityLevels.split(",");
		for (String level : securityLevels) {
			if (String.valueOf(currentUserSecurityLevel).equals(level)) {
				return true;
			}
		}
		return false;
	}
}
